Class Rewards
- java.lang.Object
-
- page.codeberg.terratactician_expandoria.world.Rewards
-
-
Constructor Summary
Constructors Constructor Description Rewards()Creates a empty Rewards (list)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Rewardsdeserialize(org.json.JSONArray data)deserializes a reward list from a json objectRewardget(int i)Gets the Reward by index.booleanisEmpty()If no reward is available.java.util.Iterator<Reward>iterator()intsize()Amount of collectable rewards.java.lang.StringtoString()
-
-
-
Field Detail
-
rewards
public java.util.List<Reward> rewards
list of all rewards
-
-
Method Detail
-
deserialize
public static Rewards deserialize(org.json.JSONArray data)
deserializes a reward list from a json object- Parameters:
data- json data- Returns:
- deserialized rewards
-
get
public Reward get(int i) throws java.lang.IndexOutOfBoundsException
Gets the Reward by index.- Parameters:
i- index in a list- Returns:
- collectable reward
- Throws:
java.lang.IndexOutOfBoundsException- if the reward does not exists
-
size
public int size()
Amount of collectable rewards.- Returns:
- amount of rewards
-
isEmpty
public boolean isEmpty()
If no reward is available.- Returns:
- if no reward is available
-
iterator
public java.util.Iterator<Reward> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Reward>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-